<template>
  <div class="app-container">
    <div class="app-head">
      <el-form>
        <el-row type="flex" justify="start">
          <el-col :span="10">
            <el-form-item label="产品ID" label-width="80px">
              <el-input v-model="productId" style="width:90%" size="mini" />
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="产品名称" label-width="80px">
              <el-input v-model="name" style="width:90%" size="mini" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="产品上线状态" label-width="130px">
              <el-select
                v-model="productExistsStatus"
                style="width:90%"
                size="mini"
                placeholder="请选择"
              >
                <el-option value="" label="全部" />
                <el-option value="1" label="上线" />
                <el-option value="0" label="下线" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="2" class="flexd">
            <span v-show="platformArr.length > 0">
              <el-button
                v-powerbtn="{power: 'business-product-search'}"
                size="mini"
                type="primary"
                round
                icon="el-icon-search"
                @click="tabClick"
              >查询</el-button>
            </span>
          </el-col>
        </el-row>
        <el-row>
          <el-col v-show="tabss === 'first1'" :span="10">
            <el-form-item label="审核状态" label-width="80px">
              <el-select
                ref="vipHeight"
                v-model="reviewStatus"
                style="width:90%"
                size="mini"
                placeholder="请选择"
              >
                <el-option value="" label="全部" />
                <el-option value="0" label="待提审" />
                <el-option value="1" label="审核中" />
                <el-option value="2" label="已通过" />
                <el-option value="3" label="未通过" />
                <!-- <el-option
                  v-for="item of pay"
                  :key="item.billingChannelId"
                  :value="item.billingChannelId"
                  :label="item.billingChannelName"
                /> -->
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="产品类型" label-width="80px">
              <el-select
                v-model="type"
                style="width:90%"
                size="mini"
                placeholder="请选择"
              >
                <el-option value="" label="全部" />
                <el-option
                  v-for="item of typeArr"
                  :key="item.typeId"
                  :value="item.typeId"
                  :label="item.typeName"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="当前配置上线状态" label-width="130px">
              <el-select
                v-model="status"
                style="width:90%"
                size="mini"
                placeholder="请选择"
              >
                <el-option value="" label="全部" />
                <el-option value="0" label="上线" />
                <el-option value="1" label="下线" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="2" :offset="tabss !== 'first1' ? 10 : 0" class="flexd">
            <el-button
              size="mini"
              plain
              round
              icon="el-icon-refresh"
              @click="reset"
            >
              重置
            </el-button>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start">
          <el-col :span="10">
            <el-form-item label="创建时间" label-width="80px">
              <el-date-picker
                v-model="startDate"
                :picker-options="pickerOptions1"
                :editable="false"
                :style="tiemLen"
                type="datetime"
                size="mini"
                format="yyyy-MM-dd HH:mm:ss"
                value-format="yyyy-MM-dd HH:mm:ss   "
                placeholder="选择开始时间"
                @change="checkStartTime"
              />
              <span style="display: inline-block;width:16px;">至</span>
              <el-date-picker
                v-model="endDate"
                :picker-options="pickerOptions2"
                :style="tiemLen"
                :editable="false"
                type="datetime"
                size="mini"
                format="yyyy-MM-dd HH:mm:ss"
                value-format="yyyy-MM-dd HH:mm:ss   "
                placeholder="选择结束时间"
                @change="checkTime"
              />
            </el-form-item>
          </el-col>
          <el-col v-show="platformArr.length > 1" :span="10">
            <el-form-item label="所属平台:" label-width="80px">
              <el-radio-group v-model="radio1" size="mini" style="margin-left: -10px;margin-right:-4px">
                <el-radio-button label="0">精确</el-radio-button>
                <el-radio-button label="1">模糊</el-radio-button>
              </el-radio-group>
              <el-select
                v-model="platformId"
                style="width:60%"
                multiple
                size="mini"
                placeholder="请选择"
              >
                <el-option
                  v-for="item of platformArr"
                  :key="item.idVal"
                  :value="item.idVal"
                  :label="item.powerName"
                />
                <!-- <el-option
                  v-for="item of platformArr"
                  :key="item.typeId"
                  :value="item.typeId"
                  :label="item.typeName"
                /> -->
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <el-tabs v-model="tabss" type="border-card" @tab-click="handleClick">
      <el-tab-pane label="全部" name="first1">
        <div class="addBtns">
          <el-button
            v-powerbtn="{power: 'business-product-insert'}"
            type="primary"
            size="mini"
            round
            icon="el-icon-circle-plus-outline"
            @click="add"
          >新建</el-button>
          <el-button
            v-powerbtn="{power: 'business-product-toCheck'}"
            :disabled="checkStatus"
            type="primary"
            size="mini"
            round
            icon="el-icon-success"
            @click="upManage"
          >提交审核</el-button>
          <el-button
            v-powerbtn="{power: 'business-product-downLine'}"
            :disabled="changeOut"
            type="primary"
            size="mini"
            round
            icon="el-icon-error"
            @click="allGoOut"
          >批量下线</el-button>
        </div>
        <div class="app-table">
          <el-table ref="multipleTable" highlight-current-row :data="list" border style="width: 100%" @selection-change="handleSelectionChange">
            <el-table-column
              type="selection"
              width="55"
            />
            <el-table-column fixed label="产品ID">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.productId" :content="scope.row.productId" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.productId }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column fixed label="产品名称">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.name" :content="scope.row.name" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.name }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column label="创建时间">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.createTime" :content="scope.row.createTime" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.createTime }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column label="产品上线状态" width="98px">
              <template slot-scope="scope">
                {{ scope.row.productExistsStatus === '0' ? '下线' : '上线' }}
              </template>
            </el-table-column>
            <el-table-column label="当前配置上线状态" width="125px">
              <template slot-scope="scope">
                {{ scope.row.status === '0' ? '上线' : '下线' }}
              </template>
            </el-table-column>

            <el-table-column label="产品类型" width="98px">
              <template slot-scope="scope">
                <!-- <el-popover v-if="scope.row.productType" :content="scope.row.productType" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.productType }}</span>
                </el-popover> -->
                {{ scope.row.productType }}
                <!-- <span v-if="scope.row.productType === '0'">
                  增值产品
                </span>
                <span v-else>
                  基础产品
                </span> -->
              </template>
            </el-table-column>

            <el-table-column label="排序号" width="80px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.sequence" :content="scope.row.sequence" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.sequence }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="创建人" width="102px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.createPerson" :content="scope.row.createPerson" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.createPerson }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="所属平台" width="180px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.platformName" :content="scope.row.platformName" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.platformName }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="审核状态" width="85px">
              <template slot-scope="scope">
                <span v-if="scope.row.reviewStatus === '0'">
                  待提审
                </span>
                <span v-if="scope.row.reviewStatus === '1'">
                  审核中
                </span>
                <span v-if="scope.row.reviewStatus === '2'">
                  已通过
                </span>
                <span v-if="scope.row.reviewStatus === '3'">
                  <el-popover v-if="scope.row.reviewStatus" :content="scope.row.reason" placement="top" trigger="hover">
                    <span slot="reference" style="cursor:pointer;color: #409EFF">未通过</span>
                  </el-popover>
                </span>
              </template>
            </el-table-column>

            <el-table-column label="操作" width="440">
              <template slot-scope="scope">
                <el-button
                  v-powerbtn="{power: 'business-product-update'}"
                  :disabled="scope.row.reviewStatus === '1'"
                  type="primary"
                  plain
                  style="margin-left:0"
                  size="mini"
                  round
                  @click="edit(scope.row.productId, scope.row.id)"
                >编辑</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-find'}"
                  type="primary"
                  plain
                  style="margin-left:0"
                  round
                  size="mini"
                  @click="watch(scope.row.productId, scope.row.id)"
                >查看</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-copy'}"
                  style="margin-left:0"
                  type="primary"
                  plain
                  round
                  size="mini"
                  @click="copy(scope.row.productId, scope.row.id)"
                >复制</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-onLineNo'}"
                  type="primary"
                  plain
                  style="margin-left:0"
                  size="mini"
                  round
                  @click="upLine(scope.row.productId, scope.row.id)"
                >上线配置记录</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-downLine'}"
                  :disabled="scope.row.productExistsStatus !== '1'"
                  :type="scope.row.productExistsStatus !== '1' ? 'info' : 'primary'"
                  round
                  plain
                  style="margin-left:0"
                  size="mini"
                  @click="noLonger(scope.row.id)"
                >下线</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-backCheck'}"
                  :disabled="scope.row.reviewStatus !== '1'"
                  :type="scope.row.reviewStatus !== '1' ? 'info' : 'primary'"
                  style="margin-left:0"
                  round
                  plain
                  size="mini"
                  @click="recall(scope.row.id)"
                >撤回审核</el-button>
              </template>
            </el-table-column>
          </el-table>
          <div class="pagination-container">
            <el-pagination :current-page.sync="pageid" :page-sizes="[20,50,100]" :page-size="pagecount" :total="count" background highlight-current-row layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane label="待提审" name="second1">
        <div class="addBtns">
          <el-button
            v-powerbtn="{power: 'business-product-insert'}"
            type="primary"
            size="mini"
            round
            icon="el-icon-circle-plus-outline"
            @click="add"
          >新建</el-button>
          <el-button
            v-powerbtn="{power: 'business-product-toCheck'}"
            :disabled="checkStatus"
            type="primary"
            size="mini"
            round
            icon="el-icon-success"
            @click="upManage"
          >提交审核</el-button>
          <el-button
            v-powerbtn="{power: 'business-product-downLine'}"
            :disabled="changeOut"
            type="primary"
            size="mini"
            round
            icon="el-icon-error"
            @click="allGoOut"
          >批量下线</el-button>
        </div>
        <div class="app-table">
          <el-table ref="multipleTable1" highlight-current-row :data="waitList" border style="width: 100%" @selection-change="handleSelectionChange">
            <el-table-column
              type="selection"
              width="55"
            />
            <el-table-column fixed label="产品ID">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.productId" :content="scope.row.productId" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.productId }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column fixed label="产品名称">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.name" :content="scope.row.name" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.name }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column label="创建时间">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.createTime" :content="scope.row.createTime" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.createTime }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column label="产品上线状态" width="98px">
              <template slot-scope="scope">
                {{ scope.row.productExistsStatus === '0' ? '下线' : '上线' }}
              </template>
            </el-table-column>
            <el-table-column label="当前配置上线状态" width="125px">
              <template slot-scope="scope">
                {{ scope.row.status === '0' ? '上线' : '下线' }}
              </template>
            </el-table-column>

            <el-table-column label="产品类型" width="98px">
              <template slot-scope="scope">
                <!-- <el-popover v-if="scope.row.productType" :content="scope.row.productType" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.productType }}</span>
                </el-popover> -->
                {{ scope.row.productType }}
                <!-- <span v-if="scope.row.productType === '0'">
                  增值产品
                </span>
                <span v-else>
                  基础产品
                </span> -->
              </template>
            </el-table-column>

            <!-- <el-table-column label="排序号">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.sequence" :content="scope.row.sequence" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.sequence }}</span>
                </el-popover>
              </template>
            </el-table-column> -->

            <el-table-column label="创建人" width="102px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.createPerson" :content="scope.row.createPerson" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.createPerson }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="所属平台" width="180px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.platformName" :content="scope.row.platformName" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.platformName }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <!-- <el-table-column label="审核状态">
              <template slot-scope="scope">
                <span v-if="scope.row.reviewStatus === '0'">
                  待提审
                </span>
                <span v-if="scope.row.reviewStatus === '1'">
                  审核中
                </span>
                <span v-if="scope.row.reviewStatus === '2'">
                  已通过
                </span>
                <span v-if="scope.row.reviewStatus === '3'">
                  未通过
                </span>
              </template>
            </el-table-column> -->

            <el-table-column label="操作" width="360">
              <template slot-scope="scope">
                <el-button
                  v-powerbtn="{power: 'business-product-update'}"
                  :disabled="scope.row.reviewStatus === '1'"
                  type="primary"
                  style="margin-left:0"
                  size="mini"
                  round
                  plain
                  @click="edit(scope.row.productId, scope.row.id)"
                >编辑</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-find'}"
                  type="primary"
                  style="margin-left:0"
                  round
                  plain
                  size="mini"
                  @click="watch(scope.row.productId, scope.row.id)"
                >查看</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-copy'}"
                  style="margin-left:0"
                  type="primary"
                  plain
                  round
                  size="mini"
                  @click="copy(scope.row.productId, scope.row.id)"
                >复制</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-onLineNo'}"
                  type="primary"
                  style="margin-left:0"
                  size="mini"
                  plain
                  round
                  @click="upLine(scope.row.productId, scope.row.id)"
                >上线配置记录</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-downLine'}"
                  :disabled="scope.row.productExistsStatus !== '1'"
                  :type="scope.row.productExistsStatus !== '1' ? 'info' : 'primary'"
                  round
                  plain
                  style="margin-left:0"
                  size="mini"
                  @click="noLonger(scope.row.id)"
                >下线</el-button>
              </template>
            </el-table-column>
          </el-table>
          <div class="pagination-container">
            <el-pagination :current-page.sync="pageid1" :page-sizes="[20,50,100]" :page-size="pagecount" :total="count1" background highlight-current-row layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange1" @current-change="handleCurrentChange1" />
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane label="审核中" name="third1">
        <div class="addBtns">
          <el-button
            v-powerbtn="{power: 'business-product-insert'}"
            type="primary"
            size="mini"
            round
            icon="el-icon-circle-plus-outline"
            @click="add"
          >新建</el-button>
          <!-- <el-button
            type="success"
            size="mini"
            round
            icon="el-icon-success"
            @click="upManage"
          >提交审核</el-button>
          <el-button
            type="danger"
            size="mini"
            round
            icon="el-icon-error"
            @click="allGoOut"
          >批量下线</el-button> -->
        </div>
        <div class="app-table">
          <el-table ref="multipleTable2" highlight-current-row :data="checkIng" border style="width: 100%" @selection-change="handleSelectionChange">
            <!-- <el-table-column
              type="selection"
              width="55"
            /> -->
            <el-table-column fixed label="产品ID">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.productId" :content="scope.row.productId" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.productId }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column fixed label="产品名称">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.name" :content="scope.row.name" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.name }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column label="创建时间">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.createTime" :content="scope.row.createTime" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.createTime }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column label="产品上线状态" width="98px">
              <template slot-scope="scope">
                {{ scope.row.productExistsStatus === '0' ? '下线' : '上线' }}
              </template>
            </el-table-column>
            <el-table-column label="当前配置上线状态" width="125px">
              <template slot-scope="scope">
                {{ scope.row.status === '0' ? '上线' : '下线' }}
              </template>
            </el-table-column>

            <el-table-column label="产品类型" width="98px">
              <template slot-scope="scope">
                <!-- <el-popover v-if="scope.row.productType" :content="scope.row.productType" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.productType }}</span>
                </el-popover> -->
                {{ scope.row.productType }}
              </template>
            </el-table-column>

            <el-table-column label="排序号" width="80px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.sequence" :content="scope.row.sequence" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.sequence }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="创建人" width="102px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.createPerson" :content="scope.row.createPerson" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.createPerson }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="所属平台" width="180px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.platformName" :content="scope.row.platformName" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.platformName }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <!-- <el-table-column label="审核状态">
              <template slot-scope="scope">
                <span v-if="scope.row.reviewStatus === '0'">
                  待提审
                </span>
                <span v-if="scope.row.reviewStatus === '1'">
                  审核中
                </span>
                <span v-if="scope.row.reviewStatus === '2'">
                  已通过
                </span>
                <span v-if="scope.row.reviewStatus === '3'">
                  未通过
                </span>
              </template>
            </el-table-column> -->

            <el-table-column label="操作" width="390">
              <template slot-scope="scope">
                <el-button
                  v-powerbtn="{power: 'business-product-find'}"
                  type="primary"
                  style="margin-left:0"
                  round
                  size="mini"
                  plain
                  @click="watch(scope.row.productId, scope.row.id)"
                >查看</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-copy'}"
                  style="margin-left:0"
                  type="primary"
                  round
                  plain
                  size="mini"
                  @click="copy(scope.row.productId, scope.row.id)"
                >复制</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-onLineNo'}"
                  type="primary"
                  style="margin-left:0"
                  size="mini"
                  plain
                  round
                  @click="upLine(scope.row.productId, scope.row.id)"
                >上线配置记录</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-downLine'}"
                  :disabled="scope.row.productExistsStatus !== '1'"
                  :type="scope.row.productExistsStatus !== '1' ? 'info' : 'primary'"
                  round
                  plain
                  style="margin-left:0"
                  size="mini"
                  @click="noLonger(scope.row.id)"
                >下线</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-backCheck'}"
                  :disabled="scope.row.reviewStatus !== '1'"
                  :type="scope.row.reviewStatus !== '1' ? 'info' : 'primary'"
                  style="margin-left:0"
                  round
                  plain
                  size="mini"
                  @click="recall(scope.row.id)"
                >撤回审核</el-button>
              </template>
            </el-table-column>
          </el-table>
          <div class="pagination-container">
            <el-pagination :current-page.sync="pageid2" :page-sizes="[20,50,100]" :page-size="pagecount" :total="count2" background highlight-current-row layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange2" @current-change="handleCurrentChange2" />
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane label="已通过" name="fourth1">
        <div class="addBtns">
          <el-button
            v-powerbtn="{power: 'business-product-insert'}"
            type="primary"
            size="mini"
            round
            icon="el-icon-circle-plus-outline"
            @click="add"
          >新建</el-button>
          <!-- <el-button
            type="success"
            size="mini"
            round
            icon="el-icon-success"
            @click="upManage"
          >提交审核</el-button> -->
          <el-button
            v-powerbtn="{power: 'business-product-downLine'}"
            :disabled="changeOut"
            type="primary"
            size="mini"
            round
            icon="el-icon-error"
            @click="allGoOut"
          >批量下线</el-button>
        </div>
        <div class="app-table">
          <el-table ref="multipleTable3" highlight-current-row :data="outGo" border style="width: 100%" @selection-change="handleSelectionChange">
            <el-table-column
              type="selection"
              width="55"
            />
            <el-table-column fixed label="产品ID">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.productId" :content="scope.row.productId" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.productId }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column fixed label="产品名称">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.name" :content="scope.row.name" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.name }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column label="创建时间">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.createTime" :content="scope.row.createTime" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.createTime }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column label="产品上线状态" width="98px">
              <template slot-scope="scope">
                {{ scope.row.productExistsStatus === '0' ? '下线' : '上线' }}
              </template>
            </el-table-column>
            <el-table-column label="当前配置上线状态" width="125px">
              <template slot-scope="scope">
                {{ scope.row.status === '0' ? '上线' : '下线' }}
              </template>
            </el-table-column>

            <el-table-column label="产品类型" width="98px">
              <template slot-scope="scope">
                <!-- <el-popover v-if="scope.row.productType" :content="scope.row.productType" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.productType }}</span>
                </el-popover> -->
                {{ scope.row.productType }}
              </template>
            </el-table-column>

            <el-table-column label="排序号" width="80px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.sequence" :content="scope.row.sequence" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.sequence }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="创建人" width="102px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.createPerson" :content="scope.row.createPerson" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.createPerson }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="所属平台" width="180px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.platformName" :content="scope.row.platformName" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.platformName }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <!-- <el-table-column label="审核状态">
              <template slot-scope="scope">
                <span v-if="scope.row.reviewStatus === '0'">
                  待提审
                </span>
                <span v-if="scope.row.reviewStatus === '1'">
                  审核中
                </span>
                <span v-if="scope.row.reviewStatus === '2'">
                  已通过
                </span>
                <span v-if="scope.row.reviewStatus === '3'">
                  未通过
                </span>
              </template>
            </el-table-column> -->

            <el-table-column label="操作" width="360">
              <template slot-scope="scope">
                <el-button
                  v-powerbtn="{power: 'business-product-update'}"
                  type="primary"
                  style="margin-left:0"
                  size="mini"
                  round
                  plain
                  @click="edit(scope.row.productId, scope.row.id)"
                >编辑</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-find'}"
                  type="primary"
                  style="margin-left:0"
                  round
                  plain
                  size="mini"
                  @click="watch(scope.row.productId, scope.row.id)"
                >查看</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-copy'}"
                  style="margin-left:0"
                  type="primary"
                  round
                  plain
                  size="mini"
                  @click="copy(scope.row.productId, scope.row.id)"
                >复制</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-onLineNo'}"
                  type="primary"
                  style="margin-left:0"
                  size="mini"
                  round
                  plain
                  @click="upLine(scope.row.productId, scope.row.id)"
                >上线配置记录</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-downLine'}"
                  :disabled="scope.row.productExistsStatus !== '1'"
                  :type="scope.row.productExistsStatus !== '1' ? 'info' : 'primary'"
                  round
                  plain
                  style="margin-left:0"
                  size="mini"
                  @click="noLonger(scope.row.id)"
                >下线</el-button>
              </template>
            </el-table-column>
          </el-table>
          <div class="pagination-container">
            <el-pagination :current-page.sync="pageid3" :page-sizes="[20,50,100]" :page-size="pagecount" :total="count3" background highlight-current-row layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange3" @current-change="handleCurrentChange3" />
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane label="未通过" name="fifth1">
        <div class="addBtns">
          <el-button
            v-powerbtn="{power: 'business-product-insert'}"
            type="primary"
            size="mini"
            round
            icon="el-icon-circle-plus-outline"
            @click="add"
          >新建</el-button>
        </div>
        <div class="app-table">
          <el-table ref="multipleTable4" highlight-current-row :data="noGo" border style="width: 100%" @selection-change="handleSelectionChange">
            <el-table-column
              type="selection"
              width="55"
            />
            <el-table-column fixed label="产品ID">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.productId" :content="scope.row.productId" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.productId }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column fixed label="产品名称">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.name" :content="scope.row.name" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.name }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column label="创建时间">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.createTime" :content="scope.row.createTime" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.createTime }}</span>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column label="产品上线状态" width="98px">
              <template slot-scope="scope">
                {{ scope.row.productExistsStatus === '0' ? '下线' : '上线' }}
              </template>
            </el-table-column>
            <el-table-column label="当前配置上线状态" width="125px">
              <template slot-scope="scope">
                {{ scope.row.status === '0' ? '上线' : '下线' }}
              </template>
            </el-table-column>

            <el-table-column label="产品类型" width="98px">
              <template slot-scope="scope">
                <!-- <el-popover v-if="scope.row.productType" :content="scope.row.productType" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.productType }}</span>
                </el-popover> -->
                {{ scope.row.productType }}
              </template>
            </el-table-column>

            <el-table-column label="排序号" width="80px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.sequence" :content="scope.row.sequence" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.sequence }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="创建人" width="102px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.createPerson" :content="scope.row.createPerson" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.createPerson }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="所属平台" width="180px">
              <template slot-scope="scope">
                <el-popover v-if="scope.row.platformName" :content="scope.row.platformName" placement="top" trigger="hover">
                  <span slot="reference" style="cursor:pointer">{{ scope.row.platformName }}</span>
                </el-popover>
              </template>
            </el-table-column>

            <el-table-column label="审核状态" width="85px">
              <template slot-scope="scope">
                <span v-if="scope.row.reviewStatus === '0'">
                  待提审
                </span>
                <span v-if="scope.row.reviewStatus === '1'">
                  审核中
                </span>
                <span v-if="scope.row.reviewStatus === '2'">
                  已通过
                </span>
                <span v-if="scope.row.reviewStatus === '3'">
                  <el-popover v-if="scope.row.reviewStatus" :content="scope.row.reason" placement="top" trigger="hover">
                    <span slot="reference" style="cursor:pointer;color: #409EFF">未通过</span>
                  </el-popover>
                </span>
              </template>
            </el-table-column>

            <el-table-column label="操作" width="360">
              <template slot-scope="scope">
                <el-button
                  v-powerbtn="{power: 'business-product-update'}"
                  :disabled="scope.row.reviewStatus === '1'"
                  type="primary"
                  style="margin-left:0"
                  size="mini"
                  round
                  plain
                  @click="edit(scope.row.productId, scope.row.id)"
                >编辑</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-find'}"
                  type="primary"
                  style="margin-left:0"
                  round
                  plain
                  size="mini"
                  @click="watch(scope.row.productId, scope.row.id)"
                >查看</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-copy'}"
                  style="margin-left:0"
                  type="primary"
                  round
                  plain
                  size="mini"
                  @click="copy(scope.row.productId, scope.row.id)"
                >复制</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-onLineNo'}"
                  type="primary"
                  plain
                  style="margin-left:0"
                  size="mini"
                  round
                  @click="upLine(scope.row.productId, scope.row.id)"
                >上线配置记录</el-button>
                <el-button
                  v-powerbtn="{power: 'business-product-downLine'}"
                  :disabled="scope.row.productExistsStatus !== '1'"
                  :type="scope.row.productExistsStatus !== '1' ? 'info' : 'primary'"
                  round
                  plain
                  style="margin-left:0"
                  size="mini"
                  @click="noLonger(scope.row.id)"
                >下线</el-button>
                <!-- <el-button
                  :disabled="scope.row.reviewStatus !== '1'"
                  type="warning"
                  style="margin-left:0"
                  round
                  size="mini"
                  @click="recall(scope.row.id)"
                >撤回审核</el-button> -->
              </template>
            </el-table-column>
          </el-table>
          <div class="pagination-container">
            <el-pagination :current-page.sync="pageid4" :page-sizes="[20,50,100]" :page-size="pagecount" :total="count4" background highlight-current-row layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange4" @current-change="handleCurrentChange4" />
          </div>
        </div>
      </el-tab-pane>
    </el-tabs>
    <up-line :version-id="versionId" :read-id="readId" :version-dialog="versionDialog" @closeVersion="closeVersion" />
    <detail-pro :detail-dialog="detailDialog" :pro-id="proId" :key-id="keyId" @closeWatch="closeWatch" />
    <add-pro :add-dialog="addDialog" @closeAdd="closeAdd" />
    <edit-pro :edit-dialog="editDialog" :pro-id="proId" :key-id="keyId" @closeEdit="closeEdit" />
    <copy-pro :copy-dialog="copyDialog" :pro-id="proId" :key-id="keyId" @closeCopy="closeCopy" />
  </div>
</template>
<script>
import { getList, revocation, goOut, getSelectS, allUpLine, goOutLots } from '@/api/product.js'
import { mapGetters } from 'vuex'
import powerbtn from '@/directive/powerbtn/index.js'
import upLine from './components/upLine.vue'
import detailPro from './components/detailPro.vue'
import addPro from './components/add.vue'
import editPro from './components/edit.vue'
import copyPro from './components/copy.vue'
export default {
  directives: {
    powerbtn
  },
  components: {
    upLine: upLine,
    detailPro: detailPro,
    addPro: addPro,
    editPro: editPro,
    copyPro
  },
  data() {
    return {
      tabss: 'first1',
      statusCheck: [], // 审核状态
      copyDialog: false, // 复制遮罩
      list: [], // 请求列表
      waitList: [], // 待提审
      checkIng: [], // 审核中
      outGo: [], // 已通过
      noGo: [], // 未通过
      flag: true,
      flag1: true,
      flag2: true,
      flag3: true,
      flag4: true,
      proId: '', // 产品id
      keyId: '', // 主键di
      productStatus: [],
      productExistsStatus: '', // 线上是否存在本产品
      reviewStatus: '', // 审核状态
      type: '', // 类型
      radio1: '0',
      productId: '', // 产品id
      status: '', // 状态
      typeArr: [], // 产品类型
      platformArr: [], // 平台
      versionId: '', // 版本id
      platformId: [], // 所属平台
      name: '', // 产品名
      pageid: 1, // 当前页数
      pageid1: 1, // 当前页数
      pageid2: 1, // 当前页数
      pageid3: 1, // 当前页数
      pageid4: 1, // 当前页数
      pagecount: 20, // 每页可显示条数
      statuss: false, // 请求状态
      versionDialog: false, // 上线版本遮罩
      detailDialog: false, // 查看遮罩
      addDialog: false, // 新增遮罩
      editDialog: false, // 编辑遮罩
      arr: [], // 产品数组主键
      count: 0, // 总数量
      count1: 0, // 总数量
      count2: 0, // 总数量
      count3: 0, // 总数量
      count4: 0, // 总数量
      watchId: '0',
      watchproductId: '0',
      readId: '0',
      tiemLen: '',
      pickerOptions1: {
        disabledDate(time) {
          return time.getTime() > Date.now()
        }
      },
      pickerOptions2: {
        disabledDate(time) {
          return time.getTime() > Date.now()
        }
      },
      startDate: '',
      endDate: ''
    }
  },
  computed: {
    ...mapGetters(['plat']),
    // 提交审核
    checkStatus() {
      if (this.statusCheck.length > 0) {
        for (let i = 0; i < this.statusCheck.length; i++) {
          if (this.statusCheck[i] === '1' || this.statusCheck[i] === '2' || this.statusCheck[i] === '3') {
            return true
          }
        }
      }
      if (this.statusCheck.length === 0) {
        return false
      } else {
        return false
      }
    },
    // 下线
    changeOut() {
      if (this.productStatus.length > 0) {
        for (let i = 0; i < this.productStatus.length; i++) {
          if (this.productStatus[i] !== '1') {
            return true
          }
        }
      }
      if (this.productStatus.length === 0) {
        return false
      } else {
        return false
      }
    }
  },
  mounted() {
    this.$nextTick(() => {
      var len = this.$refs.vipHeight.$el.offsetWidth / 2 - 10
      console.log(len)
      this.tiemLen = {
        'width': len + 'px'
      }
    })
    this.platformArr = this.plat
    if (this.platformArr.length > 1) {
      this.platformArr.forEach(item => {
        var len = item.powerCode.lastIndexOf('-')
        item.idVal = item.powerCode.substr(len + 1)
      })
      this.loadSelect()
      this.loadList(true)
    }
    if (this.platformArr.length === 1) {
      var sina = this.platformArr[0].powerCode.lastIndexOf('-')
      this.platformId = this.platformArr[0].powerCode.substr(sina + 1)
      console.log(this.platformId)
      this.loadSelect()
      this.loadList(true)
    }
  },
  methods: {
    handleClick(val) {
      this.$refs.multipleTable.clearSelection()
      this.$refs.multipleTable1.clearSelection()
      this.$refs.multipleTable2.clearSelection()
      this.$refs.multipleTable3.clearSelection()
      this.$refs.multipleTable4.clearSelection()
      this.arr = []
      if (this.tabss === 'second1') {
        this.loadList1('second1')
      } else if (this.tabss === 'third1') {
        this.loadList1('third1')
      } else if (this.tabss === 'fourth1') {
        this.loadList1('fourth1')
      } else if (this.tabss === 'fifth1') {
        this.loadList1('fifth1')
      } else if (this.tabss === 'first1') {
        this.loadList()
      }
    },
    closeCopy(val) {
      this.copyDialog = false
      if (val === true) {
        this.tabss = 'first1'
        this.loadList()
      }
    },
    // 批量下线
    allGoOut() {
      if (this.arr.length === 0) {
        this.$message({
          type: 'error',
          message: '请选择产品！'
        })
        return false
      }
      this.$confirm('确认下线所选产品吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        var data = {
          idList: this.arr
        }
        goOutLots(data).then(res => {
          if (res.resultCode === '0000') {
            this.$message({
              type: 'success',
              message: '提交成功！'
            })
            this.arr = []
            this.tabss = 'first1'
            this.loadList()
          }
        })
      }).catch(() => {
        console.log('取消')
      })
    },
    // 多选
    handleSelectionChange(val) {
      if (val.length > 0) {
        this.arr = val.map(item => {
          return item.id
        })
        this.statusCheck = val.map(item => {
          return item.reviewStatus
        })
        this.productStatus = val.map(item => {
          return item.productExistsStatus
        })
      }
      if (val.length === 0) {
        this.arr = []
        this.statusCheck = []
        this.productStatus = []
      }
    },
    add() {
      this.addDialog = true
    },
    closeAdd(val) {
      this.addDialog = false
      if (val === true) {
        this.tabss = 'first1'
        this.loadList()
      }
    },
    // 提交审核
    upManage() {
      if (this.arr.length === 0) {
        this.$message({
          type: 'error',
          message: '请选择产品！'
        })
        return false
      }
      var data = {
        idList: this.arr
      }
      this.$confirm('确认对所选产品发起上线审核吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        allUpLine(data).then(res => {
          if (res.resultCode === '0000') {
            this.$message({
              type: 'success',
              message: '提交成功！'
            })
            this.arr = []
            this.tabss = 'first1'
            this.loadList()
          }
        })
      }).catch(() => {
        console.log('取消')
      })
    },
    loadSelect() {
      // 所属平台
      /* getSelectS({ functionType: 'platform' }).then(res => {
        this.platformArr = res.data.list
      }) */
      // 产品类型
      getSelectS({ functionType: 'productType' }).then(res => {
        this.typeArr = res.data.list
      })
    },
    // 上线版本遮罩
    closeVersion() {
      this.versionDialog = false
    },
    // 上线版本
    upLine(productId, id) {
      this.versionId = productId
      this.readId = id
      this.versionDialog = true
    },
    // 下线
    noLonger(id) {
      this.$confirm('确认下线所选产品吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        goOut({
          idList: [id]
        }).then(res => {
          if (res.resultCode === '0000') {
            this.$message({
              type: 'success',
              message: '下线成功！'
            })
            this.tabss = 'first1'
            this.loadList()
          }
        })
      }).catch(() => {
        console.log('下线取消')
      })
    },
    // 撤回审核
    recall(id) {
      this.$confirm('确认撤回该产品的审核吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        revocation({
          idList: [id]
        }).then(res => {
          if (res.resultCode === '0000') {
            this.$message({
              type: 'success',
              message: '撤回成功！'
            })
            this.tabss = 'first1'
            this.loadList()
          }
        })
      }).catch(() => {
        console.log('撤回取消')
      })
    },
    edit(productId, id) {
      this.proId = productId
      this.keyId = id
      this.editDialog = true
    },
    copy(productId, id) {
      this.proId = productId
      this.keyId = id
      this.copyDialog = true
    },
    closeEdit(val) {
      this.editDialog = false
      if (val === true) {
        this.tabss = 'first1'
        this.loadList()
      }
    },
    // 查看
    watch(productId, id) {
      this.proId = productId
      this.keyId = id
      this.detailDialog = true
    },

    // 查看回调
    closeWatch() {
      this.detailDialog = false
    },
    tabClick() {
      if (this.tabss === 'first1') {
        this.loadList()
      } else {
        this.loadList1(this.tabss)
      }
    },
    loadList(val) {
      this.pageid = 1
      if (val === true) {
        var len = this.platformArr.length
        if (len > 1) {
          this.radio1 = '1'
        } else {
          this.radio1 = '0'
        }
      }
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: this.reviewStatus, // 审核状态
        pageid: 1, // 当前页数
        pagecount: 20 // 每页可显示条数
      }
      getList(request).then(res => {
        if (res.resultCode === '0000') {
          // var list = res.data.list
          this.list = res.data.list
          this.count = parseInt(res.data.count) // 总数量
          this.statuss = true
        }
      }).catch(() => {
        this.$message({
          message: '请求列表失败',
          type: 'error'
        })
      })
    },
    loadList1(status) {
      this.pageid1 = 1
      this.pageid2 = 1
      this.pageid3 = 1
      this.pageid4 = 1
      var reviewStatus
      // var pageId
      if (status === 'second1') {
        reviewStatus = '0'
      } else if (this.tabss === 'third1') {
        reviewStatus = '1'
      } else if (this.tabss === 'fourth1') {
        reviewStatus = '2'
      } else if (this.tabss === 'fifth1') {
        reviewStatus = '3'
      }
      /* this.pageid = 1
      console.log(this.pageid1)
      this.pageid1 = 1
      this.pageid2 = 1
      this.pageid3 = 1
      this.pageid4 = 1 */
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: reviewStatus, // 审核状态
        pageid: 1, // 当前页数
        pagecount: 20 // 每页可显示条数
      }
      getList(request).then(res => {
        if (res.resultCode === '0000') {
          console.log(status)
          if (status === 'second1') {
            this.waitList = res.data.list
            this.count1 = parseInt(res.data.count) // 总数量
          } else if (status === 'third1') {
            this.checkIng = res.data.list // 列表项
            this.count2 = parseInt(res.data.count) // 总数量
          } else if (status === 'fourth1') {
            this.outGo = res.data.list // 列表项
            this.count3 = parseInt(res.data.count) // 总数量
          } else if (status === 'fifth1') {
            this.noGo = res.data.list // 列表项
            this.count4 = parseInt(res.data.count) // 总数量
          }
          this.statuss = true
        }
      }).catch(() => {
        this.$message({
          message: '请求列表失败',
          type: 'error'
        })
      })
    },
    // 重置
    reset() {
      if (this.platformArr.length > 1) {
        this.radio1 = '1'
        this.platformId = []
      }
      console.log(this.platformId)
      this.productId = ''
      this.type = ''
      this.name = ''
      this.beginTime = ''
      this.endTime = ''
      this.status = ''
      this.productExistsStatus = ''
      this.reviewStatus = ''
      this.startDate = ''
      this.endDate = ''
    },
    // 校验开始时间
    checkStartTime(time) {
      const reg = new RegExp('-', 'g')
      // 比较是否大于现在的时间
      var selectTime
      if (!!time) { // eslint-disable-line
        selectTime = new Date(time.replace(reg, '/')).getTime() // 所选时间
      } else {
        selectTime = ''
      }
      const nowTime = Date.now() // 现在的时间
      if (selectTime > nowTime) {
        this.$alert('所选时间不能大于当前时间！', '提示', {
          confirmButtonText: '确定',
          callback: action => {
            this.startDate = ''
          }
        })
      } else {
        if (!!time) {  // eslint-disable-line
          var end
          if (this.endDate !== null) {
            end = new Date(this.endDate.replace(reg, '/')).getTime()
          } else {
            end = ''
          }
          var first = new Date(time.replace(reg, '/')).getTime()
          if (!!end && first > end) {
            this.$message({
              message: '开始时间不能大于结束时间',
              type: 'error'
            })
            this.startDate = ''
          }
        }
      }
    },

    // 校验结束时间
    checkTime(time) {
      const reg = new RegExp('-', 'g')
      // console.log(newStr)
      var selectTime
      if (!!time) { // eslint-disable-line
        selectTime = new Date(time.replace(reg, '/')).getTime() // 所选时间
      } else {
        selectTime = ''
      }
      const nowTime = Date.now() // 现在的时间
      if (selectTime > nowTime) {
        this.$alert('所选时间不能大于当前时间！', '提示', {
          confirmButtonText: '确定',
          callback: action => {
            this.endDate = ''
          }
        })
      } else {
        if (!!time) {  // eslint-disable-line
          var start
          if (this.startDate !== null) {
            start = new Date(this.startDate.replace(reg, '/')).getTime()
          } else {
            start = ''
          }
          var end = new Date(time.replace(reg, '/')).getTime()
          if (end < start) {
            this.$message({
              message: '开始时间不能大于结束时间',
              type: 'error'
            })
            this.endDate = ''
          }
        }
      }
    },
    // 当前页面显示条数改变时
    handleSizeChange(num) {
      this.flag = false
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: this.reviewStatus, // 审核状态
        pageid: 1, // 当前页数
        pagecount: num // 每页可显示条数
      }
      console.log('请求数据')
      console.log(request)
      getList(request).then(res => {
        this.list = res.data.list // 列表项
        this.count = parseInt(res.data.count) // 总数量
        this.pageid = 1
        this.pagecount = num
        this.flag = true
      }).catch(() => {
        this.$message({
          message: '请求列表失败，请重试',
          type: 'error'
        })
      })
    },
    // 当前页面显示条数改变时
    handleSizeChange1(num) {
      this.flag = false
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: '0', // 审核状态
        pageid: 1, // 当前页数
        pagecount: num // 每页可显示条数
      }
      console.log('请求数据')
      console.log(request)
      getList(request).then(res => {
        this.list = res.data.list // 列表项
        this.count = parseInt(res.data.count) // 总数量
        this.pageid = 1
        this.pagecount = num
        this.flag = true
      }).catch(() => {
        this.$message({
          message: '请求列表失败，请重试',
          type: 'error'
        })
      })
    },
    // 当前页面显示条数改变时
    handleSizeChange2(num) {
      this.flag = false
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: '1', // 审核状态
        pageid: 1, // 当前页数
        pagecount: num // 每页可显示条数
      }
      console.log('请求数据')
      console.log(request)
      getList(request).then(res => {
        this.list = res.data.list // 列表项
        this.count = parseInt(res.data.count) // 总数量
        this.pageid = 1
        this.pagecount = num
        this.flag = true
      }).catch(() => {
        this.$message({
          message: '请求列表失败，请重试',
          type: 'error'
        })
      })
    },
    // 当前页面显示条数改变时
    handleSizeChange3(num) {
      this.flag = false
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: '2', // 审核状态
        pageid: 1, // 当前页数
        pagecount: num // 每页可显示条数
      }
      console.log('请求数据')
      console.log(request)
      getList(request).then(res => {
        this.list = res.data.list // 列表项
        this.count = parseInt(res.data.count) // 总数量
        this.pageid = 1
        this.pagecount = num
        this.flag = true
      }).catch(() => {
        this.$message({
          message: '请求列表失败，请重试',
          type: 'error'
        })
      })
    },
    // 当前页面显示条数改变时
    handleSizeChange4(num) {
      this.flag = false
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: '3', // 审核状态
        pageid: 1, // 当前页数
        pagecount: num // 每页可显示条数
      }
      console.log('请求数据')
      console.log(request)
      getList(request).then(res => {
        this.list = res.data.list // 列表项
        this.count = parseInt(res.data.count) // 总数量
        this.pageid = 1
        this.pagecount = num
        this.flag = true
      }).catch(() => {
        this.$message({
          message: '请求列表失败，请重试',
          type: 'error'
        })
      })
    },
    // 跳转某页
    handleCurrentChange(num) {
      console.log(num)
      this.pageid = num // 当前页数
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: this.reviewStatus, // 审核状态
        pageid: num, // 当前页数
        pagecount: this.pagecount // 每页可显示条数
      }
      console.log('请求数据')
      console.log(request)
      // if (this.flag === true) {
      getList(request).then(response => {
        this.list = response.data.list // 列表项
        this.count = parseInt(response.data.count) // 总数量
        console.log('返回数据')
        console.log(response.data)
      })
      // }
    },
    // 跳转某页
    // 待提审
    handleCurrentChange1(num) {
      console.log(num)
      this.pageid = num // 当前页数
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: '0', // 审核状态
        pageid: num, // 当前页数
        pagecount: this.pagecount // 每页可显示条数
      }
      console.log('请求数据')
      console.log(request)
      // if (this.flag === true) {
      //  this.waitList = []
      getList(request).then(response => {
        this.waitList = response.data.list // 列表项
        console.log(response.data.list)
        this.count1 = parseInt(response.data.count) // 总数量
        console.log('返回数据')
        console.log(response.data)
      })
      // }
    },
    handleCurrentChange2(num) {
      console.log(num)
      this.pageid = num // 当前页数
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: '1', // 审核状态
        pageid: num, // 当前页数
        pagecount: this.pagecount // 每页可显示条数
      }
      console.log('请求数据')
      console.log(request)
      // if (this.flag === true) {
      getList(request).then(response => {
        this.checkIng = response.data.list // 列表项
        this.count2 = parseInt(response.data.count) // 总数量
        console.log('返回数据')
        console.log(response.data)
      })
      // }
    },
    handleCurrentChange3(num) {
      console.log(num)
      this.pageid = num // 当前页数
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: '2', // 审核状态
        pageid: num, // 当前页数
        pagecount: this.pagecount // 每页可显示条数
      }
      console.log('请求数据')
      console.log(request)
      // if (this.flag === true) {
      getList(request).then(response => {
        this.outGo = response.data.list // 列表项
        this.count3 = parseInt(response.data.count) // 总数量
        console.log('返回数据')
        console.log(response.data)
      })
      // }
    },
    handleCurrentChange4(num) {
      console.log(num)
      this.pageid = num // 当前页数
      const request = {
        inquiryMode: this.radio1,
        productId: this.productId,
        productType: this.type,
        name: this.name,
        platformId: Array.isArray(this.platformId) ? this.platformId.join(',') : this.platformId,
        beginTime: this.startDate,
        endTime: this.endDate,
        status: this.status,
        productExistsStatus: this.productExistsStatus,
        reviewStatus: '3', // 审核状态
        pageid: num, // 当前页数
        pagecount: this.pagecount // 每页可显示条数
      }
      console.log('请求数据')
      console.log(request)
      // if (this.flag === true) {
      getList(request).then(response => {
        this.noGo = response.data.list // 列表项
        this.count4 = parseInt(response.data.count) // 总数量
        console.log('返回数据')
        console.log(response.data)
      })
      // }
    }
  }
}
</script>
<style scoped>
.timeLength{
  width: 37.5% !important;
}
.app-head{
  margin-bottom: 10px;
}
</style>

<style>
.el-radio-button--mini .el-radio-button__inner{
  padding: 7px 7px !important;
}
.el-radio-button__inner{
  font-size: 10px !important;
}
</style>
